package action_行为型.chain_of_responsibility_pattern_责任链模式;

/**
 * Created with IntelliJ IDEA.
 *
 * @Auther: hihi
 * @Date: 2020/07/07/17:18
 * @Description:
 */
public class ChainOfResponsibilityPatternDemo {

	public static void main(String[] args) {
		AbstractLogger errorLogger = new ErrorLogger(AbstractLogger.ERROR);
		AbstractLogger fileLogger = new FileLogger(AbstractLogger.DEBUG);
		AbstractLogger consoleLogger = new ConsoleLogger(AbstractLogger.INFO);

		errorLogger.setNextAbstractLogger(consoleLogger);
		fileLogger.setNextAbstractLogger(consoleLogger);

		errorLogger.logMessage(AbstractLogger.DEBUG, "info...");
	}
}
